<?php
/**
 *   Kaltura Browser - administrator/components/com_kaltura/controllers/contenteditor.php
 *   Author: Juan Dapena Paz (juan@bittingbits.com)
 *   Copyright (C) 2011 Bitting Bits S.L.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controller');
class KalturaControllerContentselector extends JController
{
    function __construct() {
        if (JRequest::getCmd('view') == '') {
            JRequest::getVar('view', 'default');
        }
        $this->item_type = 'Default';
        parent::__construct();
    }
    
    function showcontent() {
        $instance_id = JRequest::getVar('iid');
        $search = JRequest::getVar('freesearch');
        
        $model =& $this->getModel('entries');
        $instances =& $this->getModel('instances');
        
        $view =& $this->getView('contenteditor', 'html');
        $view->setModel($model, true);
        $view->setModel($instances);
        
        $view->display();
    }
    
    function sync() {
        $iid = JRequest::getVar('iid');
        
        $model = $this->getModel('entries');
        $model->sync($iid);
    }
}
?>
